package cn.ffcs.bpmpvc.services;

import java.io.File;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import cn.ffcs.base.model.BaseEntity;
import cn.ffcs.bpm.model.ProcTranRecord;
import cn.ffcs.bpm.model.ProcessConfigDetail;
import cn.ffcs.bpmpvc.dao.AppBusinessReqDao;
import cn.ffcs.bpmpvc.dao.PocReqPlanDao;
import cn.ffcs.bpmpvc.services.bean.ConfigBean;
import cn.ffcs.bpmpvc.svc.TaskAssignBean;
import cn.ffcs.bpmpvc.web.views.TaskView;
import cn.ffcs.businessrequest.model.BusinessReason;
import cn.ffcs.businessrequest.model.BusinessRequest;
import cn.ffcs.businessrequest.model.ProdAdvReq;
import cn.ffcs.businessrequest.model.ReqDelay;
import cn.ffcs.businessrequest.model.ReqProgress;
import cn.ffcs.businessrequest.service.BusinessRequestService;
import cn.ffcs.organ.model.Organization;
import cn.ffcs.organ.model.Person;

public interface AppBusinessReqService
{
    
    public AppBusinessReqDao getAppBusinessReqDao();
    
    @SuppressWarnings("unchecked")
	public BusinessRequestService getBusinessRequestService();
    /**
     * 变更当前办理人
     * @param procInstId
     * @param nowMan
     * @param businessReason
     */
    public void changeTransactor(Integer procInstId,String nowMan,BusinessReason businessReason);
    
    public Organization getOrgByPerson(Person person );
    /**
     * 保存并启动新产品开发流程
     * @param processConfigId
     * @param person
     * @param nextTasksList
     * @param isCommit
     * @param businessRequest
     * @param uploads
     * @param fileNames
     * @return
     * @throws Exception
     */
    public ProcTranRecord saveBusinessReqAndStartFlow(String processConfigId,Person person,List<TaskAssignBean> nextTasksList,boolean isCommit,BusinessRequest businessRequest,List<File> uploads, List<String> fileNames) throws Exception;

    /**
     * 启动优化需求流程
     * @param processConfigId
     * @param person
     * @param nextTasksList
     * @param isCommit
     * @param prodAdvReq
     * @param uploads
     * @param fileNames
     * @return
     * @throws Exception
     */
    public ProcTranRecord saveProdReqAndStartFlow(String processConfigId,Person person,List<TaskAssignBean> nextTasksList,boolean isCommit,ProdAdvReq prodAdvReq,List<File> uploads, List<String> fileNames) throws Exception;
    /**
     * 保存优化需求及提交任务
     * @param flowTaskId
     * @param content
     * @param nextTasksList
     * @param isCommit
     * @param uploads
     * @param fileNames
     * @param delDocumentIds
     * @throws Exception
     */
    public void saveProdDataAndCommitTask(String flowTaskId, String content,List<TaskAssignBean> nextTasksList,boolean isCommit,List<File> uploads, List<String> fileNames,List<String> delDocumentIds) throws Exception;
    /**
     * 需求单评审保存
     * @param flowTaskId
     * @param content
     * @param nextTasksList
     * @param isCommit
     * @param procinstId
     * @param auditResult
     * @param uploads
     * @param fileNames
     * @param delDocumentIds
     * @throws Exception
     */
    public void saveProdCheckAndCommitTask(String flowTaskId, String content,List<TaskAssignBean> nextTasksList,boolean isCommit,String procinstId,String auditResult,List<File> uploads, List<String> fileNames,List<String> delDocumentIds) throws Exception;
        
    /**
     * 提交计划完成时间
     * @param flowTaskId
     * @param content
     * @param nextTasksList
     * @param isCommit
     * @param bsRequest
     * @param uploads
     * @param fileNames
     * @param delDocumentIds
     * @throws Exception
     */
    public void saveReqPlanAndCommitTask(String flowTaskId, String content,List<TaskAssignBean> nextTasksList,boolean isCommit,BusinessRequest bsRequest,List<File> uploads, List<String> fileNames,List<String> delDocumentIds) throws Exception;
    
    /**
     * 
     * @param flowTaskId
     * @param content
     * @param nextTasksList
     * @param isCommit
     * @param confirmPlanCheck
     * @param uploads
     * @param fileNames
     * @param delDocumentIds
     * @throws Exception
     */
    public void saveConfirmPlanTask(String flowTaskId, String content,List<TaskAssignBean> nextTasksList,boolean isCommit,String confirmPlanCheck,List<File> uploads, List<String> fileNames,List<String> delDocumentIds) throws Exception;
    /**
     * 方案确认，任务回退
     * @param flowTaskId
     * @param content
     * @param confirmPlanCheck
     */
    public void rollConfirmPlanTask(String flowTaskId, String content,String confirmPlanCheck);
        
    /**
     * 
     * @param flowTaskId
     * @param content
     * @param nextTasksList
     * @param isCommit
     * @param uploads
     * @param fileNames
     * @param delDocumentIds
     * @throws Exception
     */
    public void saveDataAndCommitTask(String flowTaskId, String content,List<TaskAssignBean> nextTasksList,boolean isCommit,List<File> uploads, List<String> fileNames,List<String> delDocumentIds) throws Exception;
    /**
     * 
     * @param flowTaskId
     * @param content
     * @param nextTasksList
     * @param isCommit
     * @param bsReq
     * @param uploads
     * @param fileNames
     * @param delDocumentIds
     * @throws Exception
     */
    public void saveAppDataAndCommitTask(String flowTaskId, String content,List<TaskAssignBean> nextTasksList,boolean isCommit,BusinessRequest bsReq,List<File> uploads, List<String> fileNames,List<String> delDocumentIds) throws Exception;
        
    /**
     * 保存进展信息
     * TODO 请输入方法说明
     * @param reqProgress
     */
    public void saveDoProcess(ReqProgress reqProgress);
    /**
     * 保存进展延迟信息
     * TODO 请输入方法说明
     * @param reqDelay
     */
    public void saveDoDelay(ReqDelay reqDelay);
    /**
     * 得到用户进展信息
     * TODO 请输入方法说明
     * @param businessRequest
     * @param taskView
     * @return
     */
    //public void getReqProgressAndDelay(BusinessRequest businessRequest,TaskView taskView);
    /**
     * 得到用户进展信息
     * @param businessRequest
     * @param tasklist
     */
    public void getReqProgressAndDelay(BusinessRequest businessRequest, List<ProcTranRecord> tasklist);
    /**
     * 生成需求单号
     * @return
     */
	public String getReqCode();

    /**
     * 通过改进需求审核流程启动 产品改进需求流程
     * @param reqId
     * @return
     */
    public ProcTranRecord startImproveFlow(String reqId);
    /**
     * 保存分解需求单
     * @param reqCode
     * @param bsReqList
     * @param processConfigId
     */
    public void saveResoleBsReq(String reqCode,List<BusinessRequest> bsReqList,String processConfigId);
    /**
     * 保存合并需求单
     * @param reqCode
     * @param businessRequest
     * @param processConfigId
     * @return
     */
    public Integer saveMergeBsReq(String reqCode, BusinessRequest businessRequest,String processConfigId);

    /**
     * 
     * @return
     */
    public ConfigBean getConfigBean();
    /**
     * 启动改进需求单
     * @param reqId
     * @param processConfigId
     */
    public BusinessRequest startReq(String reqId,String processConfigId,HttpServletRequest request);
    /**
     * 得到优化需求流程ID
     * @return
     */
    public String getFlowImproveReqProcessId();
    /**
     * 取得优化需求快速流程
     * @return
     */
    public String getFlowFastImproveReqProcessId();
    /**
     * 得到新产品开发流程ID
     * @return
     */
    public String getFlowNewReqProcessId();
    
    /**
     * 得到优化需求审核流程ID
     * @return
     */
    public String getFlowImproveReqCheckProcessId();
    /**
     * 得到合同提醒流程ID
     * @return
     */
    public String getFlowContractRemindProcessId();
    /**
     * 取得延迟申请流程ID
     * @return
     */
    public String getFlowReqDelayProcessId();
    /**
     * 根据角色取得产品经理人员列表
     * @return
     */
    public List<Person> findProdListByRole();
    /**
     * 
     * @return
     */
    public PocReqPlanDao getPocReqPlanDao();
    
    /**
     * 删除需求单
     * @param procInstId
     * @param businessReason
     */
    public void delete(Integer procInstId,String type,BusinessReason businessReason);
    /**
     * 强制结束需求单
     * @param procInstId
     * @param businessReason
     */
    public void toEnd(Integer procInstId,BusinessReason businessReason);
    /**
     * 判断用户是否为产品经理
     * @param personId
     * @return
     */
    public boolean checkPersonIsProd(String personId);
    /**
     * 合同业务退出流程
     * @return
     */
    public String getFlowContractBussOutProcessId();
    /**
     * 短、彩信申请流程
     * @return
     */
    public String getAppSmsProcessId();
    /**
     * 附件保存
     * @param obj
     * @param procTranRecord
     * @param uploads
     * @param fileTypes
     * @param delDocumentIds
     * @param processDetail
     */
    public void saveDocumentType(BaseEntity obj, ProcTranRecord procTranRecord, List<File> uploads, List<String> fileTypes, List<String> delDocumentIds, ProcessConfigDetail processDetail) throws Exception;
}
